﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class D_mineCommonData
{
    //游戏中所有网格对象
    public List<E_mineCube> mineEntityList;

    //暂停标记
    public bool isPause;

    //用于判断是否激活扫雷的点击触摸操作
    public bool isLockInput;

    public D_mineCommonData() {
        mineEntityList = new List<E_mineCube>();
        isPause = false;
        isLockInput = false;
    }

    //随机获取一个地雷方块
    public E_mineCube getRandomMine() {
        if (mineEntityList != null && mineEntityList.Count > 0) {
            return mineEntityList[Random.Range(0, mineEntityList.Count)];
        }
        return null;
    }

    public E_mineCube getMineCubeWithPoint(Vector2Int point) {
        foreach (var item in mineEntityList)
        {
            if (item.mineCubeData.pointID.Equals(point)) {
                return item;
            }
        }
        return null;
    }
}
